using System.ComponentModel.DataAnnotations;

namespace MediPlatform.Read.Api.Models
{
    /// <summary>
    /// 挂号订单查询请求模型
    /// </summary>
    public class RegistrationOrderQueryRequest
    {
        /// <summary>
        /// 订单号或用户名
        /// </summary>
        public string? OrderNoOrUsername { get; set; }

        /// <summary>
        /// 订单状态：0-待支付, 1-已完成, 2-已取消, 3-已退款, null-全部
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        [Range(1, int.MaxValue)]
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        [Range(1, 100)]
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 挂号订单列表项响应模型
    /// </summary>
    public class RegistrationOrderListItem
    {
        /// <summary>
        /// 挂号订单ID
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 订单编号
        /// </summary>
        public string? OrderNo { get; set; }

        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string? Username { get; set; }

        /// <summary>
        /// 医生姓名
        /// </summary>
        public string? DoctorName { get; set; }

        /// <summary>
        /// 科室名称
        /// </summary>
        public string? DepartmentName { get; set; }

        /// <summary>
        /// 挂号费
        /// </summary>
        public decimal? Fee { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 订单状态文本
        /// </summary>
        public string? StatusText { get; set; }
    }

    /// <summary>
    /// 挂号订单分页响应模型
    /// </summary>
    public class RegistrationOrderPagedResponse
    {
        /// <summary>
        /// 订单列表
        /// </summary>
        public List<RegistrationOrderListItem> Items { get; set; } = new();

        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; }

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; }
    }

    /// <summary>
    /// 挂号订单详情响应模型
    /// </summary>
    public class RegistrationOrderDetailResponse
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 订单信息
        /// </summary>
        public RegistrationOrderInfo OrderInfo { get; set; } = new();
    }

    /// <summary>
    /// 挂号订单信息
    /// </summary>
    public class RegistrationOrderInfo
    {
        /// <summary>
        /// 订单ID
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// 订单编号
        /// </summary>
        public string? OrderNo { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public long? UserId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string? Username { get; set; }

        /// <summary>
        /// 用户手机号
        /// </summary>
        public string? UserPhone { get; set; }

        /// <summary>
        /// 医院ID
        /// </summary>
        public long? HospitalId { get; set; }

        /// <summary>
        /// 医院名称
        /// </summary>
        public string? HospitalName { get; set; }

        /// <summary>
        /// 科室ID
        /// </summary>
        public long? DepartmentId { get; set; }

        /// <summary>
        /// 科室名称
        /// </summary>
        public string? DepartmentName { get; set; }

        /// <summary>
        /// 医生ID
        /// </summary>
        public long? DoctorId { get; set; }

        /// <summary>
        /// 医生姓名
        /// </summary>
        public string? DoctorName { get; set; }

        /// <summary>
        /// 预约就诊时间
        /// </summary>
        public DateTime? ScheduleTime { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 订单状态文本
        /// </summary>
        public string? StatusText { get; set; }

        /// <summary>
        /// 挂号费用
        /// </summary>
        public decimal? Fee { get; set; }

        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal? DiscountAmount { get; set; }

        /// <summary>
        /// 实际支付金额
        /// </summary>
        public decimal? ActualPayment { get; set; }

        /// <summary>
        /// 支付方式
        /// </summary>
        public string? PaymentMethod { get; set; }

        /// <summary>
        /// 支付完成时间
        /// </summary>
        public DateTime? PaymentTime { get; set; }

        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal? RefundAmount { get; set; }

        /// <summary>
        /// 退款完成时间
        /// </summary>
        public DateTime? RefundTime { get; set; }

        /// <summary>
        /// 取消原因
        /// </summary>
        public string? CancelReason { get; set; }

        /// <summary>
        /// 扩展信息
        /// </summary>
        public string? ExtraInfo { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdatedAt { get; set; }
    }

    /// <summary>
    /// 挂号订单统计响应模型
    /// </summary>
    public class RegistrationOrderStatisticsResponse
    {
        /// <summary>
        /// 总订单数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 待支付订单数
        /// </summary>
        public int PendingPaymentCount { get; set; }

        /// <summary>
        /// 已完成订单数
        /// </summary>
        public int CompletedCount { get; set; }

        /// <summary>
        /// 已取消订单数
        /// </summary>
        public int CancelledCount { get; set; }

        /// <summary>
        /// 已退款订单数
        /// </summary>
        public int RefundedCount { get; set; }
    }
} 